<?php
class User extends LastFmAbstract
{
    public function __construct() 
    {
        parent::__construct();
    }
    
    public function getArtistTracks($user, $artist, $startTimestamp = null, 
            $page = null, $endTimestamp = null)
    {
        $args['method'] = 'user.getArtistTracks';
        $args['user']   = $user;
        $args['artist'] = $artist;
        
        if(!is_null($startTimestamp))
            $args['startTimestamp'] = $startTimestamp;
        
        if(!is_null($page))
            $args['page']           = $page;
        
        if(!is_null($endTimestamp))
            $args['endTimestamp']   = $endTimestamp;
        
        return parent::request($args);
        
    }
    
    public function getBannedTracks($user, $limit = null, $page = null)
    {
        $args['method'] = 'user.getBannedTracks';
        $args['user']   = $user;
        
        if(!is_null($limit))
            $args['limit']  = $limit;
        
        if(!is_null($page))
            $args['page']   = $page;

        return parent::request($args);
    }
    
    public function getEvents($user, $page = null, $limit = null, 
            $festivalsonly = null)
    {
        $args['method'] = 'user.getEvents';
        $args['user']   = $user;
        
        if(!is_null($page))
            $args['page']  = $limit;
        
        if(!is_null($limit))
            $args['limit']  = $limit;
        
        if(!is_null($festivalsonly))
            $args['festivalsonly']  = $limit;
        
        return parent::request($args);
    }
    
    public function getFriends($user, $recenttracks = null, $limit = null, 
            $page = null)
    {
        $args['method'] = 'user.getFriends';
        return parent::request($args);
    }
    
    public function getInfo($user = null)
    {
        $args['method'] = 'user.getInfo';
        
        if(!is_null($user))
            $args['user']   = $user;
        
        return parent::request($args);
    }
    
}
?>
